#ifndef DLGAPARTMENTEDIT_H
#define DLGAPARTMENTEDIT_H

#include <QDialog>
#include "dbmseditor.h"
#include <QDoubleValidator>
#include <QListWidgetItem>

namespace Ui {
    class DlgApartmentEdit;
}

class DlgApartmentEdit : public QDialog, public DbmsEditor
{
    Q_OBJECT
    QDoubleValidator    m_qd_validator;
    QStringList       mqstrl_ids;
    QVariantHash   mqvh_spaces;
    QVariantHash    mqvh_pdates;
    int m_h_type;
    void setup_connection();
    void data_to_form();
    void form_to_data();
    void update_spaces_list();
public:
    explicit DlgApartmentEdit(QWidget *parent = 0);
    void set_focus_fld(int fld);

    ~DlgApartmentEdit();

private:
    Ui::DlgApartmentEdit *ui;
private slots:
    void data_changed() {m_data_changed = true;}
    void space_item_activated(QListWidgetItem *);
    void pdate_item_activated(QListWidgetItem *);
    void add_space();
    void del_space();
    void process_rcount();
    void slist_current_row_changed(int row);
    void plist_current_row_changed(int row);
public slots:
    void accept();


};

#endif // DLGAPARTMENTEDIT_H
